package com.metadata_system.common.enums;

import java.util.HashMap;
import java.util.Map;

// 图片验证码时间类型
public enum ImageVerifyEventType {
    login,
    register,
    sendSms,
    resetPassword,
    submitShopApply;

    private final static Map<String , ImageVerifyEventType> ENUM_MAP = new HashMap<String, ImageVerifyEventType>(64);

    static {
        for(ImageVerifyEventType v : values()) {
            ENUM_MAP.put(v.toString() , v);
        }
    }

    public static ImageVerifyEventType fromString(String v) {
        ImageVerifyEventType userOptionEnum = ENUM_MAP.get(v);
        return userOptionEnum == null ? login :userOptionEnum;
    }
}
